Skip to content

Refactoring of history code. #1328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2021
Merged

Refactoring of history code. #1328

merged 1 commit into from
Jan 20, 2021

Conversation

jonathanslenders
Copy link
Member

  • Fix race condition in ThreadedHistory. Fixes issue Assert fail in document.py when typing while large history loading #1158.
  • Refactored the history code so that asynchronous history loader
    implementations become possible.
  • Start loading the history when the BufferControl renders for the first
    time. This way we are sure that the history loading uses the same event loop
    as the one used by the application.
  • Added unit tests.
  • Make it possible to wrap InMemoryHistory in ThreadedHistory (not useful,
    but good if all combinations work).

@jonathanslenders jonathanslenders force-pushed the history-refactoring branch 6 times, most recently from 110c51b to 1c066d9 Compare January 20, 2021 15:44
- Fix race condition in ThreadedHistory. Fixes issue #1158.
- Refactored the history code so that asynchronous history loader
  implementations become possible.
- Start loading the history when the `BufferControl` renders for the first
  time. This way we are sure that the history loading uses the same event loop
  as the one used by the application. (Important for tools like ptpython where
  the `Application` can run in a different thread.)
- Added unit tests.
- Make it possible to wrap `InMemoryHistory` in `ThreadedHistory` (not that
  useful, but good if all combinations work).
- Use a deque for the working lines in buffer.py -> much better performance
  when reloading the history.

Special thanks to "Bob Hyman <bob.hyman@gmail.com>" for the original
implementations of an improved history and script for reproducing issue #1158.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant